<?php
	$css_list[0]['url'] = './tpl/css/article.css';
?>
<!--{template inc/header_n}-->

<div class="main_warp">
    <div class="inventory">
        <!--{template inc/list/list_menu}-->

        <div class="i_righter">
            <div class="i_list" id="ivtList">
                <div class="i_tt">清单[<span style="color:red;">{if $complete}已全部完成{else}未完成{/if}</span>]</div>
                <ul>
                    {loop $lists $k $v}
                    <li>
                        <a index="{$k}" href="javascript:;" class="j_a">
                            <span id="tip_{$k}" {if $session['complete'][$k]==0} style="display:none;"{/if} class="j_s j_s_yes">已完成</span>
                            {if $session['complete'][$k]==0}
                            <input id="doread_{$k}" class="j_s" type="button" onclick="doread({$k}, this)" value="完成"/>
                            {/if}
                            {$v['cate_name']}
                        </a>
                        <!--
                        <div class="j_info" style="display:{if $session['status'][$k]==1}none{else}block{/if};">
                            {$v['des']} 
                            {if $session['complete'][$k]==0}<a id="doread_{$k}" name="doread" href="javascript:;" onclick="doread({$k})" class="j_btn">完成</a>{/if}
                            <br class="g_clear" />
                        </div>-->
                    </li>
                    {/loop}
                </ul>
            </div>
        </div>
        <br class="g_clear" />

    </div>

</div>

<!--{template inc/footer}-->
<script type="text/javascript">
/*
$("#ivtList .j_a").click( function () {
    var status = 0;
    if( $(this).next('.j_info').is(":visible") ){
        $(this).next('.j_info').hide();
        $(this).children('.j_s').show();
        status = 1;
    }else{
        $(this).next('.j_info').show();
        $(this).children('.j_s').hide();
    }
    
    var index = $(this).attr('index');
    $.get('/list.php?action=lists&op=setstatus&index='+index+'&status='+status, function(s) {
        //alert(s);
    });
});

$("#ivtList .j_btn").click( function () {
    $(this).parent().parent().find('.j_s').show().addClass("j_s_yes").html("已完成");
});
*/
var f = true;
function doread(k) {
    if(f) {
        f = false;
        $.get('/list.php?action=lists&op=setcomplete&index='+k, function(s){
            $('#doread_'+k).remove();
            $('#tip_'+k).show();
            f = true;
        })
    }
}

$(document).scroll(function(a){
    var top = $(document).scrollTop();
    $.cookie('top', top); 
});

$(document).ready(function(){
    var top = $.cookie('top');
    $("html,body").animate({scrollTop:top},1000);
});
</script>